package com.wang.kmp.shared.server.exts

import com.wang.kmp.shared.Res
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.StringResource
import org.jetbrains.compose.resources.getString

@OptIn(ExperimentalResourceApi::class)
val defUri = "zk.png".let { defPng -> Res.getUri("drawable/$defPng").replace(defPng, "") }

inline fun String.replaceNativeImageUri() = replace("image://", defUri)

suspend inline fun StringResource.replaceNativeImageUri() = getString(this).replaceNativeImageUri()